package four;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import four.model.CtorBean;

/**
 * 通过构造函数组成对象，适合 不可变模式
 */
public class ConstructorConfigurationExample {
    public static void main(String[] args) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();

        CtorBean ctorBean = mapper.readValue("{\"name\":\"wpp\",\"age\":10}", CtorBean.class);
        System.out.println(ctorBean);

    }
}
